解决Pillow报错 Image size (XXX pixels) exceeds limit of 178956970 pixels, could be decompression | 您所在的位置:网站首页 › pixel box › 解决Pillow报错 Image size (XXX pixels) exceeds limit of 178956970 pixels, could be decompression |
解决Pillow报错 Image size (XXX pixels) exceeds limit of 178956970 pixels, could be decompression 1 报错代码 PIL.Image.DecompressionBombError: Image size (244186200 pixels) exceeds limit of 178956970 pixels, could be decompression bomb DOS attack. 2 报错原因原因即图片过大,超过178956970 pixels 3 解决方法最初查到的解决方法是在导入ImageFile时添加以下代码 from PIL import ImageFile ImageFile.LOAD_TRUNCATED_IMAGES = True运行后还是报错。 最终解决方法为 from PIL import ImageFile ImageFile.LOAD_TRUNCATED_IMAGES = True Image.MAX_IMAGE_PIXELS = None |
CopyRight 2018-2019 实验室设备网 版权所有 |